package com.qdu.service.impl;

import com.qdu.entity.Admin;
import com.qdu.mapper.AdminMapper;
import com.qdu.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {

    @Autowired
    AdminMapper mapper;

    @Override
    public List<Admin> getAll() {
        return mapper.getAll();
    }

    @Override
    public Admin getOneByAid(String id) {
        return mapper.getOneByAid(id);
    }

    @Override
    public Admin getOneByName(String name) {
        return mapper.getOneByName(name);
    }

    @Override
    public int addAdmin(Admin admin) {
        return mapper.addAdmin(admin);
    }

    @Override
    public int deleteAdmin(String id) {
        return mapper.deleteAdmin(id);
    }

    @Override
    public int updateAdmin(Admin admin) {
        return mapper.updateAdmin(admin);
    }

    @Override
    public List<Admin> getAdminByPage(Integer start, Integer rows) {
        return mapper.getAdminByPage(start,rows);
    }

    @Override
    public Long findTotals() {
        return mapper.findTotals();
    }
}
